<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录</title>
<style>
	.login-content{
	    border: solid;
	    border-width: 1px;
	    height: 150px;
	    width: 40%;
	    text-align: center;
	    position: relative;
	    left: 30%;
	    line-height: 50px;
	    margin-top: 150px;
	}
</style>
<script type="text/javascript" src="../static/js/jquery.min-1.11.3.js"></script>
</head>
<body>
	<div class="login-content">
		用户名：<input type="text" class="username" value="" />
		<br/>
		密码：<input type="password" class="password" value="" />
		<br/>
		<button class="login">登录</button>
	</div>
	<script type="text/javascript">
		$('.login').click(function(){
		    $.ajax({  
		        type : "GET",  //提交方式  
		        url : "/login/",//路径  
		        data : {  
		            "username" : $('.username').val(),
		            "password" : $('.password').val(),
		        },//数据，这里使用的是Json格式进行传输  
		        success : function(result) {//返回数据根据结果进行相应的处理  
		            if(result.result == 1){
		            	alert(result.msg)	
		            	window.location.href="/showUser/?pageNumber=0"; 
		            }
		            else{
		            	alert(result.msg)
		            }
		        }  
		    });
		});
	</script>
</body>
</html>